#pragma once
#include "..\utils\GameMath.h"
#include "..\dxstdafx.h"
#include "..\base\Engine.h"
#include "..\renderer\Renderer.h"
#include "..\utils\Logger.h"

namespace ds {

class IndexBuffer {

typedef std::vector<uint32> Indices;

public:
	IndexBuffer(uint32 maxIndices,bool dynamic = false);
	~IndexBuffer();
	void addIndices(uint32 indexArray[],uint32 count);
	void addIndex(uint32 idx);
	bool init();
	void clear();
    int getSize() { return m_Indices.size();}
    LPDIRECT3DINDEXBUFFER9 getIndexBuffer() { return indexBuffer;}   
private:
	bool m_Dynamic;
	uint32 m_MaxIndices;
	Indices m_Indices;
	LPDIRECT3DINDEXBUFFER9 indexBuffer;
};

};

